#ifndef KXFIRETEST_H
#define KXFIRETEST_H

#include <QtGui>
#include <QtSql>

namespace Ui {
    class kXFireTest;
}

class kXFireTest : public QDialog
{
Q_OBJECT

public:
    explicit kXFireTest(QWidget *parent = 0);

    bool    loadGamesFromDefault();
    bool    loadGamesFromFile( QString *file );
    bool    loadGamesFromDB( QString *db = 0 );

    void    clearAll();
    void    clearLog();

    bool    detectInstalledGames();

    /** DATABASE **/
    void    createGameDB( QString name );
    void    deleteGameDB( QString name, bool sure );

    QStringList getGameNames()
        { return gamenames;}


public slots:
    void    log( QString txt );

signals:
    void    gamesLoaded();

private:
    Ui::kXFireTest *m_ui;

    QSqlDatabase    igames;
    bool            createEmptyGameDB();
    QString     lgame;
    QStringList gamenames;

private slots:
    void on_listViewDetail_clicked(QModelIndex index);
    void on_listView_doubleClicked(QModelIndex index);
    void on_btnClose_clicked();
    void on_btnDetectGames_clicked();
    void on_btnClearLog_clicked();
    void on_btnClearAll_clicked();
    void on_btnLoadGamesFromDB_clicked();
    void on_btnLoadGamesFromFile_clicked();
    void on_btnLoadGamesDefault_clicked();
};

#endif // KXFIRETEST_H
